package com.petsdar.utils;

import java.util.Random;

/**
 * Created with IntelliJ IDEA
 * User: heroC
 * Date: 2020/7/5
 * Time: 10:46
 * Description: 生成随机ID
 * Version: V1.0
 */
public class IDUtil {

    /**
     * 主要用于position对象生成随机id
     * @param prefix 生成id的前缀
     * @return
     */
    public static String getId(String prefix){
        Random random = new Random();
        String rand = String.valueOf(random.nextInt(90)+10);
        String id = prefix+System.currentTimeMillis()+rand;
        return id;
    }
}
